package com.imut.oa.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.imut.oa.annotation.AutoFill;
import com.imut.oa.contant.OperationType;
import com.imut.oa.pojo.dto.MessagesPageQueryDTO;
import com.imut.oa.pojo.entity.Messages;
import com.imut.oa.pojo.vo.LeaveVO;
import com.imut.oa.pojo.vo.MessagesVO;
import org.apache.ibatis.annotations.Insert;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface MessagesMapper extends BaseMapper<Messages> {
    Page<MessagesVO> selectMessagesPage(Page<MessagesVO> page, @Param("dto") MessagesPageQueryDTO dto);

    List<Messages> getMessagesHistory(int offset, int pageSize, Long currentId);
    @AutoFill(value = OperationType.INSERT)
    @Insert("insert into messages(content,createTime,userId,status,isDelete) values(#{content},#{createTime},#{userId},#{status},#{isDelete})")
    void addMessages(Messages messages);
}
